import 'dart:convert';

import 'package:http/http.dart' as http;

const url = 'https://baidu.com';

void getSimpleTest() async {
  try {
    var data = await http.get(Uri.parse(url));
    print('data ${data.body}');
  } catch (e) {
    print('err ${e}');
  }
}

void getTest() async {
  var url = Uri.parse('https://api.github.com/users/zing-dev');
  var response =
      await http.get(url, headers: {'User-Agent': 'Dart/1.0 (My Dart client)'});
  Map<String, dynamic> repos = json.decode(response.body);
  repos.forEach((key, value) {
    print('$key : $value : ${value.runtimeType}');
  });
}

main() {
  getTest();
}
